package payment.mobilepos.unionpay.com.demo;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import payment.mobilepos.unionpay.com.zing.CaptureActivity;


public class ActivityUtils {

    public static void showPayeeSwipeActivity(Context context, String amount) {
        Intent intent = new Intent(context, PayeeSwipeActivity.class);
        intent.putExtra("amount", amount);
        context.startActivity(intent);
    }

//    public static void showCardPayeeSwipeActivity(Context context, int from, float amount) {
//        Intent intent = new Intent(context, CardPayeeSwipeActivity.class);
//        intent.putExtra("from", from);
//        intent.putExtra("amount", amount);
//        context.startActivity(intent);
//    }

    public static void showCaptureActivity(Context context) {
        Intent intent = new Intent(context, CaptureActivity.class);
        context.startActivity(intent);
    }

    public static void showBaiduActivity(Context context) {
        Intent intent = new Intent(context, CaptureActivity.class);
        context.startActivity(intent);
    }

    public static void showToast(final Context context, final String msg) {
        ((Activity) context).runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
            }
        });
    }

    public static void showToast(final Context context, final int msgResId) {
        ((Activity) context).runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(context, msgResId, Toast.LENGTH_SHORT).show();
            }
        });
    }

}

